/*
 * stringobject.h
 *
 *  Created on: Oct 27, 2009
 *      Author: price
 */

#ifndef STRINGOBJECT_H_
#define STRINGOBJECT_H_

#include "templateobject.h"

namespace templatipus {
class TStringObject: public TemplateObject {
public:

	TStringObject();
	TStringObject(const TemplateObject &other);
	TStringObject(const tbool &rhs);
	TStringObject(const int8 &rhs);
	TStringObject(const int16 &rhs);
	TStringObject(const int32 &rhs);
	TStringObject(const int64 &rhs);
	TStringObject(const float32 &rhs);
	TStringObject(const float64 &rhs);
	TStringObject(const std::wstring& rhs);
	TStringObject(const std::string& rhs);
	TStringObject(const utf8Ptr rhs);
	TStringObject(const unicodePtr rhs);
	virtual ~TStringObject();

	//conversion to numbers
	virtual tbool toBool() const PURE;
	virtual int8 toInt8() const PURE;
	virtual uint8 toUint8() const PURE;
	virtual int16 toInt16() const PURE;
	virtual uint16 toUint16() const PURE;
	virtual int32 toInt32() const PURE;
	virtual uint32 toUint32() const PURE;
	virtual int64 toInt64() const PURE;
	virtual uint64 toUint64() const PURE;
	virtual float32 toFloat32() const PURE;
	virtual float64 toFloat64() const PURE;

	//conversion to string
	virtual std::string toString() const PURE;
	virtual std::wstring toWString() const PURE;

	//methods comparison
	virtual tbool equals(const TemplateObject &other) const PURE;
	virtual tbool notEquals(const TemplateObject &other) const PURE;
	virtual tbool greater(const TemplateObject &other) const PURE;
	virtual tbool less(const TemplateObject &other) const PURE;
	virtual tbool greaterOrEquals(const TemplateObject &other) const PURE;
	virtual tbool lessOrEquals(const TemplateObject &other) const PURE;

	//Conversion operators
	virtual operator std::string() const {
		return this->toString();
	}
	virtual operator std::wstring() const {
		return this->toWString();
	}
	//Number
	virtual operator tbool() const {
		return this->toBool();
	}
	virtual operator int8() const {
		return this->toInt8();
	}
	virtual operator uint8() const {
		return this->toUint8();
	}
	virtual operator int16() const {
		return this->toInt16();
	}
	virtual operator uint16() const {
		return this->toUint16();
	}
	virtual operator int32() const {
		return this->toInt32();
	}
	virtual operator uint32() const {
		return this->toUint32();
	}
	virtual operator int64() const {
		return this->toInt64();
	}
	virtual operator uint64() const {
		return this->toUint64();
	}
	virtual operator float32() const {
		return this->toFloat32();
	}
	virtual operator float64() const {
		return this->toFloat64();
	}

	//comparison
	virtual tbool operator ==(const TemplateObject &other) const {
		return this->equals(other);
	}
	virtual tbool operator !=(const TemplateObject &other) const {
		return this->notEquals(other);
	}
	virtual tbool operator >(const TemplateObject &other) const {
		return this->greater(other);
	}
	virtual tbool operator <(const TemplateObject &other) const {
		return this->less(other);
	}
	virtual tbool operator <=(const TemplateObject &other) const {
		return this->lessOrEquals(other);
	}
	virtual tbool operator >=(const TemplateObject &other) const {
		return this->greaterOrEquals(other);
	}

};

}
#endif /* STRINGOBJECT_H_ */
